home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-13 / emacs16d.zip / LISP.MIN < prev    next >
Text File  |  1991-09-04  |  5KB  |  303 lines

  1.  
  2.  
  3. Name:Lfilename
  4. [*]lisp[*]
  5.  
  6.  
  7. Name:F:Lisp-mode
  8. Author: Clyde R. Camp
  9. This file contains the source for a basic LISP edit mode.  The
  10. following functions are provided and bound to the indicated keys for
  11. LISP and SCHEME editing modes (which are identical except for the
  12. Major Mode name).
  13.  
  14.         forward-sexp    -  M-C-f  or  M-Right Arrow
  15.            backward-sexp    -  M-C-b  or  M-Left Arrow
  16.           transpose-sext    -  M-C-t
  17.                mark-sexp    -  M-C-w
  18.                kill-sexp    -  M-C-k
  19.              lisp-indent    -  C-i  or TAB
  20.      lisp-newline-and-indent    -  C-j  or LineFeed
  21.          lisp-fill-paragraph    -  M-C-q
  22. [*]
  23. #(Fexit-mode)
  24. #(Lset-lisp-local-keys)
  25. #(Fmodename,Lisp)
  26. [*]
  27.  
  28.  
  29. Name:F:Scheme-mode
  30. Lisp Editing Mode
  31. [*]
  32. #(Fexit-mode)
  33. #(Lset-lisp-local-keys)
  34. #(Fmodename,Scheme)
  35. [*]
  36.  
  37.  
  38. Name:L:backward-sexp
  39. Move to the beginning of the current s-expression
  40. [*]
  41. #(Lbackward-skip-lisp-white)
  42. #(==,##(rc,[),0,,(
  43. #(Fcase,##(bc,##(rm,<),a,h),
  44.     (28,(   open-paren
  45.         #(sp,<)
  46.     )),
  47.     (29,(   close-paren
  48.         #(sp,<)
  49.         #(F:vip-match-paren)
  50.     )),
  51.     (22,(    quotes
  52.         #(sp,<)
  53.         #(Lbackward-skip-lisp-string)
  54.     )),
  55.     (3B,(    semi-colon
  56.         #(==,#(rc,^),1,(
  57.             #(F:previous-line)
  58.             #(Lbackward-skip-lisp-comments)
  59.             #(SELF)
  60.             ),(
  61.             #(sp,<) 
  62.             #(SELF)
  63.             ))
  64.     )),
  65.     (#(Lbackward-skip-lisp-nonwhite)
  66.     ))))    
  67. [*]
  68.  
  69.  
  70. Name:L:forward-sexp
  71. Move to the end of the current s-expression
  72. [*]
  73. #(Lforward-skip-lisp-white)
  74. #(Fcase,##(bc,##(rm,>),a,h),
  75.     (28,(   open-paren
  76.         #(Fforward-find-paren,],(##(bc,28,h,a)),(##(bc,29,h,a)))
  77.     )),
  78.     (29,(   close-paren
  79.         #(sp,>)
  80.     )),
  81.     (20,(    space
  82.         #(SELF)
  83.     )),    
  84.     (22,(    quotes
  85.         #(Lforward-skip-lisp-string)
  86.     )),
  87.     (3b,(    comment
  88.         #(SELF)
  89.     )),
  90.     (#(Lforward-skip-lisp-nonwhite)))
  91. [*]
  92.  
  93.  
  94. Name:L:kill-sexp
  95. Kill from the point to the end of the current s-expression
  96. [*]
  97. #(pm,1)
  98. #(sm,0)
  99. #(L:forward-sexp)
  100. #(Fwhitespace,(#(sp,>)))
  101. #(Fbackward-kill,0)
  102. #(pm)
  103. [*]
  104.  
  105.  
  106. Name:L:lisp-fill-paragraph
  107. [*]
  108. #(L:forward-sexp)
  109. #(Fset-new-mark,.)
  110. #(an,Adjusting S-expression....)
  111. #(L:backward-sexp)
  112. #(Ladj-next-line)
  113. #(F:pop-mark,1)
  114. #(an)
  115. [*]
  116.  
  117.  
  118. Name:L:lisp-indent
  119. Indent the current line per LISP indentation rules
  120. [*]
  121. #(pm,3)
  122. first clear leading whitespace
  123. #(sp,^)
  124. #(Ffind-non-blank,>)
  125. #(sm,1)
  126. #(sp,^)
  127. #(dm,1)
  128. #(sm,1)
  129. next find appropriate column
  130. #(L:backward-sexp)
  131. #(ds,temp,#(lv,cs))
  132. and indent that far
  133. #(sp,1)
  134. #(Fpad-to-column,##(temp))
  135. #(pm)
  136. [*]
  137.  
  138.  
  139. Name:L:lisp-newline-and-indent
  140. Newline and indent per LISP indentation rules
  141. [*]
  142. #(F:newline)
  143. #(L:lisp-indent)
  144. [*]
  145.  
  146.  
  147. Name:L:mark-sexp
  148. Set the mark at the end of the current s-expression and flash it
  149. [*]
  150. #(pm,1)
  151. #(sm,0)
  152. #(L:forward-sexp)
  153. #(F:set-mark)
  154. #(rd)
  155. #(ds,temp,#(it,100))
  156. #(==,##(temp),Timeout,,(#Fkbd-in,##(temp)))
  157. #(sp,0)
  158. #(pm)
  159. [*]
  160.  
  161.  
  162. Name:L:transpose-sexp
  163. Transpose the current s-expression with the one previous to it.
  164. USE ONLY WITH POINT AT START OF SEXP. comments (may) get confused
  165. [*]
  166. #(L:backward-sexp)
  167. #(L:kill-sexp)
  168. #(L:forward-sexp)
  169. #(Fwhitespace,(#(sp,>)))
  170. #(F:un-kill)
  171. [*]
  172.  
  173.  
  174. Name:Ladj-next-line
  175. [*]
  176. #(F:next-line)
  177. #(sp,$)
  178. #(mb,#(Fmark),(
  179.     #(L:lisp-indent)
  180.     ),(
  181.     #(L:lisp-indent)
  182.     #(SELF)))
  183. [*]
  184.  
  185.  
  186. Name:Lbackward-skip-lisp-comments
  187. [*]
  188. #(==,#(rc,[),0,,(
  189.     #(pm,3)
  190.     #(lp,;)
  191.     #(l?,^,$,0,1,(
  192.         #(sp,0)
  193.         #(==,#(rc,^),0,(
  194.             #(sp,<)
  195.             #(SELF)
  196.             ),(
  197.             #(sp,0)))))
  198.     #(pm)))
  199. [*]
  200.  
  201.  
  202. Name:Lbackward-skip-lisp-nonwhite
  203. Reverses until it hits a space, open-paren; 
  204. Stops with point to right of space or open-paren
  205. [*]#(sp,<)
  206. #(Fwhitespace,(#(sp,>)),(
  207.     #(==,##(rm,<),##(bc,28,h,a),,(
  208.     #(SELF)))))
  209. [*]
  210.  
  211.  
  212. Name:Lbackward-skip-lisp-string
  213. Scans backward past everything looking for a non-escaped " and stops on it
  214. [*]
  215. #(==,#(rm,<),("),(
  216.     #(sp,<)
  217.         #(==,#(rm,<),(\),(
  218.         #(sp,<)
  219.         #(SELF) ))
  220.     ),(
  221.     #(sp,<)
  222.     #(SELF)))
  223. [*]
  224.  
  225.  
  226. Name:Lbackward-skip-lisp-white
  227. Skips over lisp whitespace, including commented lines 
  228. [*]
  229. #(==,##(rc,[),0,,(
  230.     #(==,#(rc,^),0,(
  231.         #(Fbackward-skip-white)
  232.         #(Lbackward-skip-lisp-comments)
  233.         #(SELF)
  234.         ),(
  235.         #(sp,<)
  236.         #(Fwhitespace,(
  237.             #(SELF)
  238.             ),(
  239.             #(sp,>)))))))
  240. [*]
  241.  
  242.  
  243. Name:Lforward-skip-lisp-nonwhite
  244. Scans past all non-whitespace except close-paren
  245. [*]
  246. #(Fwhitespace,,(
  247.     #(==,##(rm,>),##(bc,29,h,a),,(
  248.         #(sp,>)
  249.         #(SELF)))))
  250. [*]
  251.  
  252.  
  253. Name:Lforward-skip-lisp-string
  254. Scans past everything looking for a non-escaped " and stops after it
  255. [*]
  256. #(sp,>)
  257. #(==,#(rm,>),\,(
  258.     #(sp,>>) 
  259.     #(SELF)
  260.     ),(
  261.     #(==,#(rm,>),",(#(sp,>)),(#(SELF)))
  262.     ))
  263. [*]
  264.  
  265.  
  266. Name:Lforward-skip-lisp-white
  267. Scans forward past all whitespace and lisp comments
  268. [*]
  269. #(Fwhitespace,(
  270.     #(sp,>) 
  271.            #(SELF)
  272.     ),(
  273.     #(==,#(rm,>),(;),(
  274.         #(sp,$>)
  275.         #(SELF)
  276.         ))))
  277. [*]
  278.  
  279.  
  280. Name:Lset-lisp-local-keys
  281. [*]
  282. #(Flocal-bind-key,K.C-j,L:lisp-newline-and-indent)
  283. #(Flocal-bind-key,K.Tab,L:lisp-indent)
  284. #(Flocal-bind-key,K.C-i,L:lisp-indent)
  285. #(Flocal-bind-key,K.M-C-k,L:kill-sexp)
  286. #(Flocal-bind-key,K.M-C-w,L:mark-sexp)
  287. #(Flocal-bind-key,K.M-C-t,L:transpose-sexp)
  288. #(Flocal-bind-key,K.PF1,L:backward-sexp)
  289. #(Flocal-bind-key,K.PF2,L:forward-sexp)
  290. #(Flocal-bind-key,K.M-C-f,L:forward-sexp)
  291. #(Flocal-bind-key,K.M-C-b,L:backward-sexp)
  292. #(Flocal-bind-key,K.M-q,L:lisp-fill-paragraph)
  293. #(Flocal-bind-key,K.M-C-q,L:lisp-fill-paragraph)
  294. #(Flocal-bind-key,K.M-Left Arrow,L:backward-sexp)
  295. #(Flocal-bind-key,K.M-Right Arrow,L:forward-sexp)
  296. [*]
  297.  
  298.  
  299. Name:Fautoload-L
  300. [*]lisp[*]
  301.  
  302.  
  303.